package com.alex.j2se.stream;

import com.google.common.collect.Lists;

import java.util.Arrays;
import java.util.List;

/**
 * Author  : gaojun            <br/>
 * Date    : 2020/7/1                          <br/>
 * Time    : 8:30 下午                         <br/>
 * ---------------------------------------    <br/>
 * Desc    :
 */
public class FlatMapTest {
    public static void main(String[] args) {
        List<String> testStr = Lists.newLinkedList();

        testStr.add("a_b_c");
        testStr.add("d_e_f");
        testStr.stream().map(s -> s.split("_")).flatMap(Arrays::stream).forEach(s -> {
            System.out.println(s);
        });
    }
}
